<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改基础抽取')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-etl-edit" th:object="${etlDrawBase}">
        <input name="idDrawBase" th:field="*{idDrawBase}" id="idDrawBase" type="hidden">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">目标表：</label>
                    <div class="col-sm-8">
                        <input name="cdTbTar" class="form-control" th:field="*{cdTbTar}" type="text" required disabled>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">名称：</label>
                    <div class="col-sm-8">
                        <input name="na" class="form-control" th:field="*{na}" type="text" required disabled>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="col-sm-12 select-table table-striped">
        <table id="bootstrap-table"></table>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "etl/base";
    $("#form-etl-edit").validate({
        focusCleanup: true
    });
    $(function() {
        var options = {
            url: prefix + "/findColums/"+$("#idDrawBase").val(),
            modalName: "字段列表",
            method: "GET",
            columns: [
                {
                    field: 'newColumnName',
                    title: '列名'
                },
                {
                    field: 'newColumnTypeName',
                    title: '类型'
                },
                {
                    field: 'newColumnPrecision',
                    title: '长度'
                },
                {
                    field: 'oldColumnScale',
                    title: '精度'
                },
                {
                    field: 'oldColumnTypeName',
                    title: 'ODS原类型'
                },
                {
                    field: 'opType',
                    title: '操作',
                    formatter: function(value, item, index) {
                        if (value == "OP_TYPE_ADD") {
                            return "添加";
                        } else if (value == "OP_TYPE_DROP") {
                            return "删除";
                        } else if (value == "OP_TYPE_MODIFY") {
                            return "修改";
                        } else {
                            return "不变";
                        }
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>